//
//  WCNCareRecordDetailFooterView.m
//  WCN
//
//  Created by 杨鑫 on 15/6/22.
//  Copyright (c) 2015年 ShanghaiCize Trade And Business Co., Ltd. All rights reserved.
//

#import "WCNCareRecordDetailFooterView.h"
//
#import "Macros.h"

@implementation WCNCareRecordDetailFooterView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}

// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
    UIBezierPath *path = [[UIBezierPath alloc] init];
    
    CGPoint start = CGPointMake(0, 5);
    [path moveToPoint:start];
    CGPoint end = CGPointMake(25, 5);
    [path addLineToPoint:end];
    end = CGPointMake(30, 0);
    [path addLineToPoint:end];
    end = CGPointMake(35, 5);
    [path addLineToPoint:end];
    end = CGPointMake(rect.size.width, 5);
    [path addLineToPoint:end];
    end = CGPointMake(rect.size.width, rect.size.height);
    [path addLineToPoint:end];
    end = CGPointMake(0, rect.size.height);
    [path addLineToPoint:end];
    [path addLineToPoint:start];
    
    [HexRGB(0xf8f8f8) setFill];
    [path fill];
    
    [path removeAllPoints];
    
    [path moveToPoint:start];
    end = CGPointMake(25, 5);
    [path addLineToPoint:CGPointPathChange(end, kLineHorizontal, 1)];
    end = CGPointMake(30, 0);
    [path addLineToPoint:CGPointPathChange(end, kLineHorizontal, 1)];
    end = CGPointMake(35, 5);
    [path addLineToPoint:CGPointPathChange(end, kLineHorizontal, 1)];
    end = CGPointMake(rect.size.width, 5);
    [path addLineToPoint:CGPointPathChange(end, kLineHorizontal, 1)];
    
    path.lineWidth = kOnePX;
    [kBorderColor setStroke];
    [path stroke];
}

@end
